import hashlib
from django.conf import settings


def get_password_hash(password: str) -> str:
    """
    获取加密密码
    :param password: 明文密码
    :return:
    """
    md5 = hashlib.md5(bytes(settings.SECRET_KEY, encoding="utf8"))
    md5.update(password.encode(encoding='UTF-8'))
    return md5.hexdigest()
